package com.genauth.sys.service;

import com.genauth.sys.dao.MenuMapper;
import com.genauth.sys.entity.MenuBean;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MenuService {

    @Resource
    private MenuMapper menuMapper;

    public List<MenuBean> queryMenu(MenuBean mb){
        return menuMapper.queryMenu(mb);
    }

    public int insertMenu(MenuBean menuBean) {
        return menuMapper.insert(menuBean);

//        return menuMapper.insertMenu(menuBean);
    }

    public int updateMenu(MenuBean menuBean) {
        return menuMapper.updateById(menuBean);
//        return menuMapper.updateMenu(menuBean);
    }

    public int deleteMenu(MenuBean menuBean) {
        return menuMapper.deleteMenu(menuBean);
//        return menuMapper.deleteMenu(menuBean);
    }

    public int countByControllerAndCode(MenuBean menuBean) {
        return menuMapper.count(menuBean);
    }
}
